Skip to content

Comments

test: track usage of hard-coded scaler clock frequencies#1128

Draft
c-dilks wants to merge 1 commit intodevelopmentfrom
magic-freq
Draft

test: track usage of hard-coded scaler clock frequencies#1128
c-dilks wants to merge 1 commit intodevelopmentfrom
magic-freq

Conversation

@c-dilks
Copy link
Member

@c-dilks c-dilks commented Feb 23, 2026

The DSC2 and STRUCK scaler clock frequencies are stored in CCDB, but they are also hard-coded. This branch adds a magic number to each of the hard-coded assignments, and checks for that magic number when they're (likely) used. Printouts to stderr starting with clockbug are used to investigate.

The DSC2 and STRUCK scaler clock frequencies are stored in CCDB, but
they are also hard-coded. This branch adds a magic number to each of the
hard-coded assignments, and checks for that magic number when they're
(likely) used. Printouts to `stderr` starting with `clockbug` are used
to investigate.
@baltzell
Copy link
Collaborator

What's the measured value of the hardware clock in question? This isn't affected by both DCS2 and Struck scalers.

@c-dilks
Copy link
Member Author

c-dilks commented Feb 24, 2026

I'm more concerned about ambiguity in the code as to whether a CCDB value is used or a hard-coded value is used here. Even if the real clock frequency never changed, we should either use a CCDB value everywhere, or define the hard-coded frequency in one single place only; the current software both uses a CCDB value and uses hard-coded values defined in 3 places, and the value is mutable.

Here are the frequencies:

  • DSC2
    • according to CCDB:
      • 1 MHz before run 14776 (from 2021 HPS run)
      • 100 kHz afterward
    • clock vs. timestamp indicates RG-A Spring 2018 may have used ~100 MHz
  • STRUCK
    • always 1 MHz according to CCDB

If the hard-coded 1 MHz is used for DSC2 for runs after 14776 to estimate the charge, that's a problem.

This PR's branch should be tested on all the usual call graphs, including:

  • recon-util / run-clara
  • postprocess
  • running with recharge true vs. false (rebuild-scalers)

@baltzell
Copy link
Collaborator

Note the DSC2 and Struck are different hardware, and can have different clocks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants